# after adjusting for ideology of author, retweeters, and ideological extremity
lm(diffID ~ tID+rtID*M+rtID*E+M*E,data=dCjoin2) %>% summary() #main model
##
## Call:
## lm(formula = diffID ~ tID + rtID * M + rtID * E + M * E, data = dCjoin2)
##
## Residuals:
## Min 1Q Median 3Q Max
## -1.2410 -0.3410 -0.1205 0.2205 3.0309
##
## Coefficients:
## Estimate Std. Error t value Pr(>|t|)
## (Intercept) 0.692524 0.005678 121.976 < 2e-16 ***
## tID 0.131844 0.006441 20.468 < 2e-16 ***
## rtID 0.104067 0.007366 14.129 < 2e-16 ***
## M -0.056894 0.005581 -10.194 < 2e-16 ***
## E 0.011838 0.005568 2.126 0.0335 *
## rtID:M -0.033011 0.006612 -4.993 0.000000603 ***
## rtID:E 0.025522 0.006181 4.129 0.000036646 ***
## M:E -0.007288 0.005172 -1.409 0.1588
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## Residual standard error: 0.5188 on 13212 degrees of freedom
## Multiple R-squared: 0.09621, Adjusted R-squared: 0.09573
## F-statistic: 200.9 on 7 and 13212 DF, p-value: < 2.2e-16
# morality plays a bigger role than emotion when it comes to ideological diversity
lm(diffID ~ tID+rtID+ex.tID*M+ex.tID*E,data=dCjoin2) %>% summary() #emo int w/ ex.tID
##
## Call:
## lm(formula = diffID ~ tID + rtID + ex.tID * M + ex.tID * E, data = dCjoin2)
##
## Residuals:
## Min 1Q Median 3Q Max
## -1.5486 -0.3407 -0.1207 0.2305 2.9905
##
## Coefficients:
## Estimate Std. Error t value Pr(>|t|)
## (Intercept) 0.529567 0.009565 55.365 < 2e-16 ***
## tID 0.151109 0.006460 23.393 < 2e-16 ***
## rtID 0.091657 0.006631 13.822 < 2e-16 ***
## ex.tID 0.228668 0.011090 20.619 < 2e-16 ***
## M 0.029456 0.009424 3.126 0.00178 **
## E 0.014220 0.008981 1.583 0.11338
## ex.tID:M -0.111751 0.010836 -10.313 < 2e-16 ***
## ex.tID:E -0.023864 0.010208 -2.338 0.01941 *
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## Residual standard error: 0.5113 on 13212 degrees of freedom
## Multiple R-squared: 0.1222, Adjusted R-squared: 0.1218
## F-statistic: 262.9 on 7 and 13212 DF, p-value: < 2.2e-16
lm(diffID ~ tID+rtID+rtID*M+rtID*E,data=dCjoin2) %>% summary() #emo int w/ rtID
##
## Call:
## lm(formula = diffID ~ tID + rtID + rtID * M + rtID * E, data = dCjoin2)
##
## Residuals:
## Min 1Q Median 3Q Max
## -1.2316 -0.3408 -0.1212 0.2206 3.0264
##
## Coefficients:
## Estimate Std. Error t value Pr(>|t|)
## (Intercept) 0.691805 0.005655 122.340 < 2e-16 ***
## tID 0.131880 0.006442 20.473 < 2e-16 ***
## rtID 0.103901 0.007365 14.108 < 2e-16 ***
## M -0.057833 0.005541 -10.437 < 2e-16 ***
## E 0.009319 0.005273 1.767 0.0772 .
## rtID:M -0.032733 0.006609 -4.952 0.000000742 ***
## rtID:E 0.026101 0.006168 4.232 0.000023323 ***
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## Residual standard error: 0.5189 on 13213 degrees of freedom
## Multiple R-squared: 0.09607, Adjusted R-squared: 0.09566
## F-statistic: 234 on 6 and 13213 DF, p-value: < 2.2e-16
lm(diffID ~ tID+rtID+tID*M+tID*E,data=dCjoin2) %>% summary()
##
## Call:
## lm(formula = diffID ~ tID + rtID + tID * M + tID * E, data = dCjoin2)
##
## Residuals:
## Min 1Q Median 3Q Max
## -1.1280 -0.3407 -0.1207 0.2204 3.0207
##
## Coefficients:
## Estimate Std. Error t value Pr(>|t|)
## (Intercept) 0.689497 0.005654 121.948 < 2e-16 ***
## tID 0.127379 0.006975 18.263 < 2e-16 ***
## rtID 0.098117 0.006764 14.507 < 2e-16 ***
## M -0.044927 0.005472 -8.210 2.41e-16 ***
## E -0.001993 0.005168 -0.386 0.700
## tID:M 0.008479 0.006335 1.339 0.181
## tID:E -0.006924 0.005873 -1.179 0.238
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## Residual standard error: 0.5196 on 13213 degrees of freedom
## Multiple R-squared: 0.09363, Adjusted R-squared: 0.09322
## F-statistic: 227.5 on 6 and 13213 DF, p-value: < 2.2e-16
lm(diffID ~ ex.tID+ex.rtID*M+ex.rtID*E+M*E,data=dCjoin2) %>% summary() #huge morality interaction
##
## Call:
## lm(formula = diffID ~ ex.tID + ex.rtID * M + ex.rtID * E + M *
## E, data = dCjoin2)
##
## Residuals:
## Min 1Q Median 3Q Max
## -0.9707 -0.3886 -0.1452 0.2472 2.9762
##
## Coefficients:
## Estimate Std. Error t value Pr(>|t|)
## (Intercept) 0.407936 0.013434 30.366 < 2e-16 ***
## ex.tID 0.094430 0.010416 9.066 < 2e-16 ***
## ex.rtID 0.171446 0.013707 12.508 < 2e-16 ***
## M 0.009758 0.012011 0.812 0.417
## E -0.002875 0.011722 -0.245 0.806
## ex.rtID:M -0.095053 0.013333 -7.129 0.00000000000106 ***
## ex.rtID:E -0.015489 0.012878 -1.203 0.229
## M:E -0.006330 0.005362 -1.181 0.238
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## Residual standard error: 0.5367 on 13212 degrees of freedom
## Multiple R-squared: 0.03293, Adjusted R-squared: 0.03242
## F-statistic: 64.27 on 7 and 13212 DF, p-value: < 2.2e-16
lm(diffID ~ ex.tID*ex.rtID*M+ex.rtID*E+M*E,data=dCjoin2) %>% summary() #morality 3-way interaction
##
## Call:
## lm(formula = diffID ~ ex.tID * ex.rtID * M + ex.rtID * E + M *
## E, data = dCjoin2)
##
## Residuals:
## Min 1Q Median 3Q Max
## -0.9179 -0.3457 -0.0928 0.2279 4.0485
##
## Coefficients:
## Estimate Std. Error t value Pr(>|t|)
## (Intercept) -0.233459 0.019649 -11.881 <2e-16 ***
## ex.tID 1.004640 0.023689 42.410 <2e-16 ***
## ex.rtID 0.950742 0.023173 41.029 <2e-16 ***
## M 0.007768 0.019668 0.395 0.6929
## E -0.027119 0.010924 -2.483 0.0131 *
## ex.tID:ex.rtID -1.045916 0.025845 -40.468 <2e-16 ***
## ex.tID:M -0.037155 0.023666 -1.570 0.1165
## ex.rtID:M -0.016328 0.023178 -0.704 0.4812
## ex.rtID:E 0.016851 0.012010 1.403 0.1606
## M:E -0.006992 0.004997 -1.399 0.1617
## ex.tID:ex.rtID:M -0.057987 0.025803 -2.247 0.0246 *
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## Residual standard error: 0.4995 on 13209 degrees of freedom
## Multiple R-squared: 0.1625, Adjusted R-squared: 0.1619
## F-statistic: 256.4 on 10 and 13209 DF, p-value: < 2.2e-16
ggplot(dCjoin2,aes(x=M,y=diffID,color=factor(E))) +
geom_smooth(method="lm")
ggplot(dCjoin2,aes(x=rtID,y=diffID,color=factor(cond))) +
geom_smooth(method="loess")
ggplot(dCjoin2,aes(x=tID,y=rtID,color=factor(cond))) +
geom_point(alpha=.1) +
geom_smooth(method="loess")
ggplot(dCjoin2,aes(x=tID,y=rtID,color=factor(E))) +
geom_point(alpha=.1) +
geom_smooth(method="loess") +
facet_grid(~M)
ggplot(dCjoin2,aes(x=tID,y=rtID,color=factor(E))) +
geom_point(alpha=.1) +
geom_smooth(method="lm") +
facet_grid(~M)
ggplot(dCjoin2,aes(x=rtID,y=diffID,color=factor(E))) +
geom_point(alpha=.1) +
geom_smooth(method="loess") +
facet_grid(~M)
ggplot(dCjoin2,aes(x=M,y=diffID,color=factor(E))) +
geom_smooth(method="lm")
ggplot(dCjoin2,aes(x=ex.rtID,y=diffID,color=factor(M))) +
geom_point(alpha=.1) +
geom_smooth(method="loess")
ggplot(dCjoin2,aes(x=ex.rtID,y=diffID,color=factor(M))) +
geom_point(alpha=.1) +
geom_smooth(method="lm")
ggplot(dCjoin2,aes(x=ex.tID,y=diffID,color=factor(M))) +
geom_point(alpha=.1) +
geom_smooth(method="loess") +
xlab("Ideological Extremity of Original Tweet Author") +
ylab("Ideological Distance of Retweeters") +
ggtitle("Comparing Ideological Similarity of Author/Retweeters\n for Moral and Nonmoral Tweets (Loess Line)")
ggplot(dCjoin2,aes(x=ex.tID,y=diffID,color=factor(M))) +
geom_point(alpha=.1) +
geom_smooth(method="lm") +
xlab("Ideological Extremity of Original Tweet Author") +
ylab("Ideological Distance of Retweeters") +
ggtitle("Comparing Ideological Similarity of Author/Retweeters\n for Moral and Nonmoral Tweets (Linear Fit)")
# # Heat maps ---------------------------------------------------------------
#
# ## functions to construct heatmaps
# min <- -3.5
# max <- 3.5
# breaks <- 0.25
#
# expand_data <- function(df, breaks=0.10, min=-4, max=4){
# x <- df$rtid %>% as.numeric()
# y <- df$tid %>% as.numeric()
# x <- (round((x - min) / breaks, 0) * breaks) + min
# y <- (round((y - min) / breaks, 0) * breaks) + min
# tab <- table(x, y)
# tab <- melt(tab)
# tab$prop <- tab$value/sum(tab$value)
# return(tab)
# }
#
# ideoHeatMap <- function(df) {
# new.xy.me <- expand_data(df %>% filter(cond=="ME"),breaks=0.25) %>% mutate(cond="ME")
# new.xy.nme <- expand_data(df %>% filter(cond=="NME"),breaks=0.25) %>% mutate(cond="NME")
# new.xy.mne <- expand_data(df %>% filter(cond=="MNE"),breaks=0.25) %>% mutate(cond="MNE")
# new.xy.nmne <- expand_data(df %>% filter(cond=="NMNE"),breaks=0.25) %>% mutate(cond="NMNE")
# return (rbind(new.xy.me,new.xy.nme,new.xy.mne,new.xy.nmne))
# }
# pairPlot(dCRTsum %>% select(tID,rtID,ex.tID,ex.rtID,diffID,M,E,RTperDay.Tr,persistDays.Tr,speedHrs.Tr))
lm(RTperDay.Tr ~ tID+diffID+speedHrs.Tr+M+E,data=dCRTsum) %>% summary() #main effects
##
## Call:
## lm(formula = RTperDay.Tr ~ tID + diffID + speedHrs.Tr + M + E,
## data = dCRTsum)
##
## Residuals:
## Min 1Q Median 3Q Max
## -0.33425 -0.08690 -0.00008 0.07990 0.54758
##
## Coefficients:
## Estimate Std. Error t value Pr(>|t|)
## (Intercept) 1.5660178 0.0230079 68.064 <2e-16 ***
## tID 0.0091754 0.0054047 1.698 0.0898 .
## diffID -0.0504023 0.0272727 -1.848 0.0648 .
## speedHrs.Tr 0.0633802 0.0017516 36.184 <2e-16 ***
## M 0.0095664 0.0049123 1.947 0.0517 .
## E -0.0004041 0.0038315 -0.105 0.9160
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## Residual standard error: 0.1269 on 1283 degrees of freedom
## Multiple R-squared: 0.5101, Adjusted R-squared: 0.5082
## F-statistic: 267.2 on 5 and 1283 DF, p-value: < 2.2e-16
lm(RTperDay.Tr ~ tID+diffID+speedHrs.Tr+M*E,data=dCRTsum) %>% summary() #main effects
##
## Call:
## lm(formula = RTperDay.Tr ~ tID + diffID + speedHrs.Tr + M * E,
## data = dCRTsum)
##
## Residuals:
## Min 1Q Median 3Q Max
## -0.33295 -0.08782 -0.00049 0.08107 0.54878
##
## Coefficients:
## Estimate Std. Error t value Pr(>|t|)
## (Intercept) 1.565970 0.023007 68.065 <2e-16 ***
## tID 0.009115 0.005405 1.686 0.0920 .
## diffID -0.048490 0.027333 -1.774 0.0763 .
## speedHrs.Tr 0.063461 0.001753 36.196 <2e-16 ***
## M 0.008990 0.004943 1.819 0.0692 .
## E 0.002058 0.004497 0.458 0.6474
## M:E -0.004655 0.004453 -1.045 0.2960
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## Residual standard error: 0.1268 on 1282 degrees of freedom
## Multiple R-squared: 0.5105, Adjusted R-squared: 0.5082
## F-statistic: 222.9 on 6 and 1282 DF, p-value: < 2.2e-16
lm(RTperDay.Tr ~ tID+rtID+ex.tID+ex.rtID+M+E+diffID,data=dCRTsum) %>% summary() #main effects
##
## Call:
## lm(formula = RTperDay.Tr ~ tID + rtID + ex.tID + ex.rtID + M +
## E + diffID, data = dCRTsum)
##
## Residuals:
## Min 1Q Median 3Q Max
## -0.49455 -0.13369 0.00296 0.10544 0.73179
##
## Coefficients:
## Estimate Std. Error t value Pr(>|t|)
## (Intercept) 1.368259 0.061270 22.332 < 2e-16 ***
## tID 0.018691 0.011169 1.674 0.094468 .
## rtID -0.040151 0.014514 -2.766 0.005748 **
## ex.tID -0.024565 0.014315 -1.716 0.086396 .
## ex.rtID 0.067601 0.027734 2.438 0.014924 *
## M -0.007935 0.007021 -1.130 0.258615
## E -0.004713 0.005436 -0.867 0.386158
## diffID 0.196698 0.057082 3.446 0.000588 ***
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## Residual standard error: 0.1791 on 1281 degrees of freedom
## Multiple R-squared: 0.02445, Adjusted R-squared: 0.01912
## F-statistic: 4.587 on 7 and 1281 DF, p-value: 0.00004475
lm(RTperDay.Tr ~ tID+rtID+ex.tID+ex.rtID+M*E*diffID,data=dCRTsum) %>% summary() #main effects
##
## Call:
## lm(formula = RTperDay.Tr ~ tID + rtID + ex.tID + ex.rtID + M *
## E * diffID, data = dCRTsum)
##
## Residuals:
## Min 1Q Median 3Q Max
## -0.48772 -0.13252 0.00411 0.10650 0.72988
##
## Coefficients:
## Estimate Std. Error t value Pr(>|t|)
## (Intercept) 1.36728 0.07135 19.164 < 2e-16 ***
## tID 0.01857 0.01117 1.663 0.09657 .
## rtID -0.03990 0.01453 -2.747 0.00610 **
## ex.tID -0.02361 0.01433 -1.647 0.09973 .
## ex.rtID 0.07113 0.02798 2.542 0.01114 *
## M -0.03518 0.04170 -0.844 0.39904
## E -0.05013 0.04151 -1.208 0.22746
## diffID 0.19989 0.06828 2.928 0.00348 **
## M:E 0.08893 0.04163 2.136 0.03287 *
## M:diffID 0.02948 0.04784 0.616 0.53792
## E:diffID 0.04388 0.04755 0.923 0.35622
## M:E:diffID -0.10182 0.04772 -2.134 0.03305 *
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## Residual standard error: 0.1791 on 1277 degrees of freedom
## Multiple R-squared: 0.02832, Adjusted R-squared: 0.01995
## F-statistic: 3.384 on 11 and 1277 DF, p-value: 0.0001235
# speed
lm(speedHrs.Tr ~ ex.tID+ex.rtID+M+E+M*diffID,data=dCRTsum) %>% summary() #main effects
##
## Call:
## lm(formula = speedHrs.Tr ~ ex.tID + ex.rtID + M + E + M * diffID,
## data = dCRTsum)
##
## Residuals:
## Min 1Q Median 3Q Max
## -6.2047 -1.3184 0.1835 1.4461 5.4510
##
## Coefficients:
## Estimate Std. Error t value Pr(>|t|)
## (Intercept) -0.25845 0.71015 -0.364 0.7160
## ex.tID -0.64654 0.13521 -4.782 0.00000194 ***
## ex.rtID 0.11647 0.30930 0.377 0.7066
## M -0.23735 0.44991 -0.528 0.5979
## E -0.03213 0.06086 -0.528 0.5976
## diffID 1.56490 0.67921 2.304 0.0214 *
## M:diffID -0.01417 0.51159 -0.028 0.9779
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## Residual standard error: 2.004 on 1282 degrees of freedom
## Multiple R-squared: 0.06356, Adjusted R-squared: 0.05918
## F-statistic: 14.5 on 6 and 1282 DF, p-value: 4.562e-16
# persistence
lm(persistDays.Tr ~ ex.rtID+M+E+diffID,data=dCRTsum) %>% summary() #main effects
##
## Call:
## lm(formula = persistDays.Tr ~ ex.rtID + M + E + diffID, data = dCRTsum)
##
## Residuals:
## Min 1Q Median 3Q Max
## -6.3776 -1.7221 -0.2204 1.8870 5.1985
##
## Coefficients:
## Estimate Std. Error t value Pr(>|t|)
## (Intercept) -3.10294 0.74005 -4.193 0.0000294 ***
## ex.rtID -0.35686 0.36116 -0.988 0.323303
## M 0.33468 0.09406 3.558 0.000387 ***
## E 0.20588 0.07292 2.823 0.004826 **
## diffID -0.90350 0.69730 -1.296 0.195304
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## Residual standard error: 2.411 on 1284 degrees of freedom
## Multiple R-squared: 0.02952, Adjusted R-squared: 0.02649
## F-statistic: 9.763 on 4 and 1284 DF, p-value: 0.00000008843
lm(persistDays.Tr ~ ex.rtID+M*E+diffID,data=dCRTsum) %>% summary() #main effects
##
## Call:
## lm(formula = persistDays.Tr ~ ex.rtID + M * E + diffID, data = dCRTsum)
##
## Residuals:
## Min 1Q Median 3Q Max
## -6.352 -1.725 -0.220 1.883 5.054
##
## Coefficients:
## Estimate Std. Error t value Pr(>|t|)
## (Intercept) -3.10558 0.74000 -4.197 0.0000289 ***
## ex.rtID -0.35550 0.36114 -0.984 0.32511
## M 0.32284 0.09468 3.410 0.00067 ***
## E 0.25461 0.08551 2.978 0.00296 **
## diffID -0.86282 0.69824 -1.236 0.21680
## M:E -0.09224 0.08454 -1.091 0.27547
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## Residual standard error: 2.411 on 1283 degrees of freedom
## Multiple R-squared: 0.03042, Adjusted R-squared: 0.02664
## F-statistic: 8.049 on 5 and 1283 DF, p-value: 0.0000001737
Virality: * M1: virality associated w/ conservative tweeters, ideological clustering, and moral content. No interaction of moral/emotion. * M2: Interaction w/ diversity, moral/emotional
Speed: * M1: virality speed is predicted by centrist tweeters and more political diversity. At first, main effect of morality – but seems this is due to larger political diversity of nonmoral condition.
Persistence: * M1: main effects of morality and emotion seem to wash out the other associations w/ retweeter extremism and political diversity. * M2: Main effects persist, but no interaction.
Conclusions: 1. Virality and Speed are strongly associated w/ ideological diversity 2. Moral/Emotion interact with this relationship ^^ (still need to unpack) 3. Moral/emotional tweets persist longer
ggplot(dCRTsum,aes(x=diffID,y=RTperDay.Tr,color=cond)) +
geom_point(alpha=.6) +
geom_smooth(method="lm")
# facet_wrap("cond",nrow=2)
ggplot(dCRTsum,aes(x=tID,y=diffID,color=factor(cond))) +
geom_smooth(method="loess")
ggplot(dCRTsum,aes(x=tID,y=diffID,color=factor(cond))) +
geom_smooth(method="lm")
ggplot(dCRTsum,aes(x=M,y=diffID,color=factor(E))) +
geom_smooth(method="lm")
ggplot(dCRTsum,aes(x=tID,y=diffID,color=factor(E))) +
geom_smooth(method="lm") +
facet_grid(~M)
ggplot(dCRTsum,aes(x=tID,y=rtID,color=factor(M))) +
geom_point(alpha=.6) +
geom_smooth(method="lm")
ggplot(dCRTsum,aes(x=diffID,y=RTperDay.Tr,color=factor(cond))) +
geom_smooth(method="lm")
ggplot(dCRTsum,aes(x=tID,y=diffID,color=factor(cond))) +
geom_smooth(method="lm")
ggplot(dCRTsum,aes(x=M,y=diffID,color=factor(E))) +
geom_smooth(method="lm")
ggplot(dCRTsum,aes(x=tID,y=diffID,color=factor(E))) +
geom_smooth(method="lm") +
facet_grid(~M)
ggplot(dCRTsum,aes(x=tID,y=rtID,color=factor(M))) +
geom_point(alpha=.6) +
geom_smooth(method="lm")